/*
 * sys.h
 *
 *  Created on: 28 Dec 2012
 *      Author: adan
 */

#ifndef SYS_H_
#define SYS_H_

#include <stdio.h>
#include <stdlib.h>

#include <SDL/SDL.h>
#include <SDL/SDL.h>
#include <SDL/SDL_gfxPrimitives.h>
#include <SDL/SDL_framerate.h>

// types
typedef Uint32 Colour;
typedef int bool;

#define TRUE 1
#define FALSE 0

extern SDL_PixelFormat* pixelFormat;
extern Uint32 convertToRGBA(Colour colour);
extern Uint32 convertToRGBABrightness(Colour colour, int brightenBy);

extern bool hasCollided(SDL_Rect* r1, SDL_Rect* r2);
extern SDL_Rect* rect(int x, int y, int w, int h);

struct Point {
	int x, y;
};
typedef struct Point Point;

// object control
extern void* createObject(size_t size);

// interfaces
typedef void (*Drawable)(SDL_Surface* dest, void* this); // Drawable(SDL_Surface* dest) interface

#endif /* SYS_H_ */
